﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using _1242026_1242133.DTO;
namespace _1242026_1242133.DAO
{
    class LoaiKhachDAO
    {
        public DataTable ThemLoaiKhach(LoaiKhachDTO LoaiKhachDto)
        {
            SqlSever sql = new SqlSever();
            SqlParameter[] arrParam = {   new SqlParameter("@MaLoaiKhach", SqlDbType.VarChar), 
                                          new SqlParameter("@TenLoaiKhach", SqlDbType.VarChar),
                                          new SqlParameter("@HeSoKhach", SqlDbType.Float),           
                                      };
            arrParam[0].Value = LoaiKhachDto.MaLoaiKhach;
            arrParam[1].Value = LoaiKhachDto.TenLoaiKhach;
            arrParam[2].Value = LoaiKhachDto.HeSoKhach;
            return sql.ExecuteStore("sp_ThemLoaiKhach", arrParam);
        }

        public DataTable LoadDanhSachLoaiKhach()
        {
            SqlSever sql = new SqlSever();
            return sql.ExecuteCommandText("select * from LoaiKhach");
        }
    }
}
